package ioStream;

import org.junit.Test;

import java.io.File;
import java.io.IOException;

/**
 * @author 杜伟毅
 * @version 1.0
 * @since 2024/09/15
 */
public class FlieStreamTest {
    @Test
    public void testEilePath() {
        System.out.println("C:\\软件\\Clash for Windows\\locales");
        File file = new File("C:\\软件\\Clash for Windows\\locales");
        File file1 = new File("C:\\Users\\白草风归\\Downloads\\Programs\\文章作法 (夏丏尊 刘薰宇) (Z-Library).mobi");
        File file2 = new File(file, "文章作法 (夏丏尊 刘薰宇) (Z-Library).mobi");
    }
    @Test
    public void testFile() throws IOException {
        File file1 = new File("C:\\Users\\白草风归\\Music\\ceshi\\img","1课程表.png");
        System.out.println(file1.exists());
        if (!file1.exists()){
//            file1.createNewFile();
            boolean delete = file1.delete();
            System.out.println(delete?"成功":"失败");
        }else {
            boolean delete = file1.delete();
            System.out.println(delete?"成功":"失败");
        }
    }
}
